﻿{layout:default} {class:Shop.Admin.cms.Image_Edit}
<lbhead>
    <title><%=node.Name%>-<%=pnode.Name%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <div class="tools">
    <ul>
    <%if (PageReturnMsg == ""){%>
    <li class="submit"><a href="javascript:void(0);" onclick="SaveObj();"><b></b><span><%=Tag("保存")%></span></a></li>
    <%}%>
    <li class="rotate"><a href="javascript:void(0);" onclick="javascript:history.back();"><b></b><span><%=Tag("返回")%></span></a></li>
    <li class="name"><span id="navIgation"><%=Tag("当前位置")%>：<a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a> > <a href="UserNodeList.aspx?code=<%=pnode.Code %>"><%=pnode.Name%></a> > <a href="<%=Shop.Bussiness.NodePage.AdminIndexPage(node) %>"><%=node.Name%></a><%if (page.Name !="") {%> > <%=page.Name%><%} %></span></li>
    </ul>
    </div>
</lbpath>
<lbbody>
    <table class="table">
        <tr>
            <th>
                <%=Tag("语言")%>：
            </th>
            <td>
                <%= Shop.Bussiness.Language.SiteLanguageCheckbox("Language_ids", page.Language_ids,CurrentLanguage.Code)%>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("标题")%>：
            </th>
            <td>
                <input type="text" id="Name" name="Name" class="input" shop="true" min="notnull" style="width: 350px;" value="<%=page.Name %>" />&nbsp;<span></span>
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("跳转页面")%>：
            </th>
            <td>
                <input type="text" id="url" name="url" class="input" style="width: 500px;" shop="true" value="<%=page.url %>" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("图片地址")%>：
            </th>
            <td>
                <div id="image_ImageSmall"><%if (page.ImageSmall != ""){%><img height="80" src="<%=page.ImageSmall%>" /><%} %></div>
                <input type="text" shop="true" min="notnull" id="ImageSmall" name="ImageSmall" class="input" style="width: 200px;" value="<%=page.ImageSmall%>" />
                <input id="file_ImageSmall" name="file_ImageSmall" class="input" type="file" />
                <input type="button" value="上传" class="button" onclick="uploadImage('ImageSmall')" />
            </td>
        </tr>
        <tr>
            <th>
                <%=Tag("排序序号")%>：
            </th>
            <td>
                <input type="text" id="Sort" name="Sort" shop="true" class="input" style="width: 120px" class="texttime" maxlength="4"  value="<%=page.Sort %>" onkeyup="value=value.replace(/[^\d]/g,'')" />
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        function uploadImage(id) {
            $.ajaxFileUpload
        (
	        {
	            url: WebPath + '/ajax/imageuploadone.aspx?path=cms',
	            secureuri: false,
	            fileElementId: 'file_' + id,
	            dataType: 'json',
	            success: function (data, status) {
	                if (data.msg != 'OK') {
	                    MsgBox(2, data.msg, "");
	                }
	                else {
	                    var imageUrl = data.ImageUrl;
	                    if (imageUrl.length > 0) {
	                        $("#image_" + id + "").html('<img height="80" src=' + imageUrl + '>');
	                        $("#" + id + "").val(imageUrl);
	                    }
	                }
	            },
	            error: function (data, status, e) {
	                MsgBox(2, data.error, "");
	            }
	        }
        )
        }
        function SaveObj() {
            var postData = GetFormJsonData("shop");
            var nodeid = $("#Node_id").val();
            if (!CheckForm("shop", "span"))
                return false;
            var url = "<%=site.AdminPath %>/ajax/ajax_node.aspx?__Action=Page_Edit&id=<%=page.id %>";
            RequestAjax(url,postData,function(){MsgBox(1, "<%=Tag("操作成功")%>", "pagelist.aspx?Node_id=" + nodeid + "")});
        }
    </script>
</lbbody>
<lbbottom>
<input type="text" id="Node_id" name="Node_id" shop="true" value="<%=page.Node_id %>" style="display:none;" />
</lbbottom> 